애드소스로 프로브 입찰 요청 전송
실제 OpenRTB BidRequest 1건을 애드소스로 전송하고 원본 응답을 반환한다.
애드소스가 4xx/5xx를 반환해도 status_code를 채운 200으로 응답한다. 벤더의
요청 거절은 이 엔드포인트의 실패가 아니라 프로브 결과다.
curl --request POST \
--url https://your_a2_service/api/manager/allocations/bid-request-probes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ad_source_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"allocation_ext": {},
"environment": "app",
"platform": "ios",
"tid": "<ad_unit_id>",
"ttype": "ad_unit"
}
'import requests
url = "https://your_a2_service/api/manager/allocations/bid-request-probes"
payload = {
"ad_source_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"allocation_ext": {},
"environment": "app",
"platform": "ios",
"tid": "<ad_unit_id>",
"ttype": "ad_unit"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ad_source_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
allocation_ext: {},
environment: 'app',
platform: 'ios',
tid: '<ad_unit_id>',
ttype: 'ad_unit'
})
};
fetch('https://your_a2_service/api/manager/allocations/bid-request-probes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your_a2_service/api/manager/allocations/bid-request-probes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ad_source_id' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'allocation_ext' => [
],
'environment' => 'app',
'platform' => 'ios',
'tid' => '<ad_unit_id>',
'ttype' => 'ad_unit'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your_a2_service/api/manager/allocations/bid-request-probes"
payload := strings.NewReader("{\n \"ad_source_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"allocation_ext\": {},\n \"environment\": \"app\",\n \"platform\": \"ios\",\n \"tid\": \"<ad_unit_id>\",\n \"ttype\": \"ad_unit\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your_a2_service/api/manager/allocations/bid-request-probes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ad_source_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"allocation_ext\": {},\n \"environment\": \"app\",\n \"platform\": \"ios\",\n \"tid\": \"<ad_unit_id>\",\n \"ttype\": \"ad_unit\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/manager/allocations/bid-request-probes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ad_source_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"allocation_ext\": {},\n \"environment\": \"app\",\n \"platform\": \"ios\",\n \"tid\": \"<ad_unit_id>\",\n \"ttype\": \"ad_unit\"\n}"
response = http.request(request)
puts response.read_body{
"bid_request": {},
"elapsed_ms": 123,
"body": "<string>",
"error": "<string>",
"status_code": 123
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}인증
Bearer 인증. 액세스 토큰을 Authorization: Bearer <token> 헤더로 전달합니다.
본문
POST /allocations/bid-request-probes 요청 본문.
테스트 입찰 요청을 보낼 애드소스
테스트 대상 게재 할당 ext
Show child attributes
Show child attributes
테스트할 환경 — web 또는 app
web, app 테스트할 단말 플랫폼. 두 환경 모두에서 벤더로 보낼 User-Agent와 device.os를 정하고, app에서는 어느 번들(ios_bundle 또는 android_bundle)을 보낼지도 정한다.
ios, android 대상 ID
대상 유형 — ad_unit만 지원
ad_unit, placement 응답
성공 응답
실제로 보낸 BidRequest와 벤더 응답.
벤더가 4xx/5xx를 돌려줘도 이 응답은 200이다. 벤더의 거절은 테스트 실패가 아니라 테스트 결과다.
실제로 전송한 BidRequest 본문
DNS·TCP·TLS 수립을 포함한 왕복 시간(밀리초). 커넥션 풀을 사용해 읽기 단계에만 적용되는 엣지 서버의 read timeout과는 비교할 수 없다.
애드소스가 반환한 원본 응답 본문. 수신 도중 16000바이트에서 끊는다
전송 계층 실패를 ExceptionClass: message 형식으로 표기 — 메시지가 동일한 connect timeout과 read timeout을 클래스 이름으로 구분한다
애드소스가 반환한 HTTP 상태 코드 — 연결에 실패하면 null
이 페이지가 도움이 되었나요?
curl --request POST \
--url https://your_a2_service/api/manager/allocations/bid-request-probes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ad_source_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"allocation_ext": {},
"environment": "app",
"platform": "ios",
"tid": "<ad_unit_id>",
"ttype": "ad_unit"
}
'import requests
url = "https://your_a2_service/api/manager/allocations/bid-request-probes"
payload = {
"ad_source_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"allocation_ext": {},
"environment": "app",
"platform": "ios",
"tid": "<ad_unit_id>",
"ttype": "ad_unit"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ad_source_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
allocation_ext: {},
environment: 'app',
platform: 'ios',
tid: '<ad_unit_id>',
ttype: 'ad_unit'
})
};
fetch('https://your_a2_service/api/manager/allocations/bid-request-probes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your_a2_service/api/manager/allocations/bid-request-probes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ad_source_id' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'allocation_ext' => [
],
'environment' => 'app',
'platform' => 'ios',
'tid' => '<ad_unit_id>',
'ttype' => 'ad_unit'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your_a2_service/api/manager/allocations/bid-request-probes"
payload := strings.NewReader("{\n \"ad_source_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"allocation_ext\": {},\n \"environment\": \"app\",\n \"platform\": \"ios\",\n \"tid\": \"<ad_unit_id>\",\n \"ttype\": \"ad_unit\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your_a2_service/api/manager/allocations/bid-request-probes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ad_source_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"allocation_ext\": {},\n \"environment\": \"app\",\n \"platform\": \"ios\",\n \"tid\": \"<ad_unit_id>\",\n \"ttype\": \"ad_unit\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/manager/allocations/bid-request-probes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ad_source_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"allocation_ext\": {},\n \"environment\": \"app\",\n \"platform\": \"ios\",\n \"tid\": \"<ad_unit_id>\",\n \"ttype\": \"ad_unit\"\n}"
response = http.request(request)
puts response.read_body{
"bid_request": {},
"elapsed_ms": 123,
"body": "<string>",
"error": "<string>",
"status_code": 123
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}